package vip.hsq168.flutterleveldb;

import android.util.Log;

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;

/**
 * FlutterLeveldbPlugin
 */
public class FlutterLeveldbPlugin implements MethodCallHandler {


    /**
     * Plugin registration.
     */
    public static void registerWith(Registrar registrar) {
        final MethodChannel channel = new MethodChannel(registrar.messenger(), "flutter_leveldb");
        channel.setMethodCallHandler(new FlutterLeveldbPlugin());
    }

    @Override
    public void onMethodCall(MethodCall call, Result result) {
        if (call.method.equals("hello")) {
            result.success(LevelDB.hello());
        } else if (call.method.equals("open")) {
            result.success("open " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("close")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("getString")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("putString")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("getLong")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("putLong")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("getBoolean")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("putBoolean")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("getDouble")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("putDouble")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("delete")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("getData")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else if (call.method.equals("putData")) {
            result.success("Android " + android.os.Build.VERSION.RELEASE);
        } else {
            result.notImplemented();
        }
    }
}
